package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpContractsQuoterDashMostRecentPageUtil extends SeleniumPageUtil {
	public final static By CQD_TD_TITLE = By.xpath("//*[@id='Panel0']/table/tbody/tr/td[4]");
	public final static By CQD_TD_CONTRACT_ID = By.xpath("//*[@id='Dashboard1_pnlSummary']/table[1]/tbody/tr/td");
	public final static By CQD_INPUT_CONTRACT_ID = By.id("Dashboard1_txtContractID");
	
	public final static By CQD_TD_NEW_QUOTES = By.xpath("//*[@id='Dashboard1_tblNewQuotesHdr']/tbody/tr/td");
	public final static By CQD_IMG_DISC = By.id("Dashboard1_imgNewQuotes");
	
	public final static By CQD_IMG_DISC_REP = By.id("Dashboard1_imgDiscreps");
	public final static By CQD_TD_DISC = By.xpath("//*[@id='Dashboard1_pnlSummary']/table[4]/tbody/tr/td");
	public final static By CQD_TD_DISC_CONTRACT_ID = By.xpath("//*[@id='tblDiscreps']/tbody/tr[2]/td[1]");
	public final static By CQD_TD_DISC_REVISION = By.xpath("//*[@id='tblDiscreps']/tbody/tr[2]/td[2]");
	public final static By CQD_TD_DISC_SUBVER = By.xpath("//*[@id='tblDiscreps']/tbody/tr[2]/td[3]");
	public final static By CQD_TD_DISC_CUSTOMER = By.xpath("//*[@id='tblDiscreps']/tbody/tr[2]/td[4]");
	public final static By CQD_TD_DISC_REASON = By.xpath("//*[@id='tblDiscreps']/tbody/tr[2]/td[5]");
	public final static By CQD_TD_DISC_ITEM_ID = By.xpath("//*[@id='tblDiscreps']/tbody/tr[2]/td[6]");
	public final static By CQD_TD_DISC_SERVIAL_NUM = By.xpath("//*[@id='tblDiscreps']/tbody/tr[2]/td[7]");
	
	public final static By CQD_TD_LP_CONTRACT_ISSUES = By.xpath("//*[@id='Dashboard1_pnlSummary']/table[6]/tbody/tr/td");
	public final static By CQD_IMG_LP_CONTRACT_ISSUES = By.id("Dashboard1_imgContracts");
	
	public final static By CQD_TD_LP_CONFIG_ISSUES = By.xpath("//*[@id='Dashboard1_pnlSummary']/table[8]/tbody/tr/td");
	public final static By CQD_IMG_LP_CONFIG_ISSUES = By.id("Dashboard1_imgBOMs");
	
	public final static By CQD_TD_LP_PRICING_ISSUES = By.xpath("//*[@id='Dashboard1_pnlSummary']/table[10]/tbody/tr/td");
	public final static By CQD_IMG_LP_PRICING_ISSUES = By.id("Dashboard1_imgPricing");
	
	public final static By CQD_TD_LP_WARR_ISSUES = By.xpath("//*[@id='Dashboard1_pnlSummary']/table[12]/tbody/tr/td");
	public final static By CQD_IMG_LP_WARR_ISSUES = By.id("Dashboard1_imgWrty");
	
	public static void enter(){
		SpContractsQuoterPageUtil.enter();
		SpContractsQuoterPageUtil.displayHidenMenus(new By[]{SpContractsQuoterPageUtil.STQ_LINK_DASH});
		SeleniumUtil.waitOnElements(new By[]{SpContractsQuoterPageUtil.STQ_LINK_DASH_BOARD});
		SeleniumUtil.click(SeleniumUtil.getCachedElement(SpContractsQuoterPageUtil.STQ_LINK_DASH_BOARD));
		SeleniumUtil.waitForFixedMilliseconds(1000);
		waitForPageToLoad();
	}

	private static void waitForPageToLoad() {
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{
		});
	}
}
